package com.xinyue.game.server.codec.message;

import com.xinyue.game.server.codec.GameMessageHeader;

public abstract class AbstractGameMessage implements IGameMessage {
	private GameMessageHeader header = new GameMessageHeader();

	public AbstractGameMessage() {
		GameMessageMeta gameMessageMeta = this.getClass().getAnnotation(GameMessageMeta.class);
		int messageId = gameMessageMeta.messageId();
		header.setMessageId(messageId);
	}

	@Override
	public GameMessageHeader getHeader() {
		return header;
	}

	@Override
	public void setHeader(GameMessageHeader header) {
		this.header = header;
	}

}
